import { ReactNode } from 'react';
import { Params, RouteObject } from 'react-router-dom';

export interface RouteMeta {
  /**
   * key 是完整路径
   */
  key: string;
  label: string;
  icon?: ReactNode;
  hideMenu?: boolean;
  hideBreadcrumb?: boolean;
  /**
   * for breadcrumb
   */
  disabled?: boolean;
  /**
   * dynamic route params
   *
   * @example /user/:id
   */
  params?: Params<string>;
  permissions?: string[];
}

export type AppRouteObject = {
  //asc order
  order?: number;
  meta?: RouteMeta;
  children?: AppRouteObject[];
} & Omit<RouteObject, 'children'>;
